import axios from 'axios'
import Vue from 'vue';
import { Toast } from 'vant';
//基本路径

//请求拦截
axios.interceptors.request.use(function (config) {
    config.headers.DeviceType = "h5"
    config.headers.Authorization = "Bearer " + localStorage.getItem("msmktoken")

    Toast.loading({
        message: '加载中...',
        forbidClick: true,
    });
    return config
}, function (error) {
    return Promise.reject(error)
})
//响应拦截
axios.interceptors.response.use(function (response) {
    Toast.clear()
    return response
}, function (error) {
    return Promise.reject(error)
})
//导出
export default axios